{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {
    "slideshow": {
     "slide_type": "slide"
    }
   },
   "source": [
    "#### ICS 104 - Introduction to Programming in Python and C\n",
    "# Pointers and Modular Programming\n",
    "## Reading Assignment"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "slideshow": {
     "slide_type": "fragment"
    }
   },
   "source": [
    "- Chapter 6: Sections 1,2, 3 and 4."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "slideshow": {
     "slide_type": "slide"
    }
   },
   "source": [
    "# Learning Outcomes  \n",
    "At the end of this chapter, you will be able to\n",
    "- use pointers and indirect addressing in writing small C programs.\n",
    "- read data from files and write data into files.\n",
    "- return function results through a function’s arguments.\n",
    "- recognize the differences between call-by-value and call-by-reference.\n",
    "- distinguish between input, in-out, and output parameters.\n",
    "- determine the scope of names in a C program."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "slideshow": {
     "slide_type": "slide"
    }
   },
   "source": [
    "# Pointers\n",
    "- How do we interpret the following declaration:\n",
    "```C  \n",
    "   double *p;\n",
    "```"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "slideshow": {
     "slide_type": "fragment"
    }
   },
   "source": [
    "- `p` is considered as a **pointer variable** of type \"pointer to double\".\n",
    "    - In current object-oriented languages notation, we say that `p` is a **reference** to a variable of type double.\n",
    "- `p` stores the address in memory of a variable of type double."
   ]
  },
  {
   "attachments": {
    "listCreate.jpg": {
     "image/jpeg": "[encoded data, 47076 characters]"
    }
   },
   "cell_type": "markdown",
   "metadata": {
    "slideshow": {
     "slide_type": "slide"
    }
   },
   "source": [
    "- Do you remember the following image?\n",
    "![listCreate.jpg](attachment:listCreate.jpg)\n",
    "- The value of `values` is a reference (or an address) (or a pointer) to a list. "
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "cell_style": "split",
    "slideshow": {
     "slide_type": "slide"
    }
   },
   "source": [
    "- Consider the following C code fragment:\n",
    "```C\n",
    "int m = 25;\n",
    "int *itemp;   /* pointer to integer */\n",
    "itemp = &m;   /* Store address of m \n",
    "                   in pointer itemp*/\n",
    "```"
   ]
  },
  {
   "attachments": {
    "variableAndPointerToVariable.PNG": {
     "image/png": "[encoded data, 9572 characters]"
    }
   },
   "cell_type": "markdown",
   "metadata": {
    "cell_style": "split",
    "slideshow": {
     "slide_type": "fragment"
    }
   },
   "source": [
    "- Assume that variable `m` is associated with memory cell 1024.\n",
    "\n",
    "![variableAndPointerToVariable.PNG](attachment:variableAndPointerToVariable.PNG)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "cell_style": "center",
    "slideshow": {
     "slide_type": "fragment"
    }
   },
   "source": [
    "# Indirect Reference\n",
    "- When we try to access the contents (value) of a memory cell through a pointer variable that stores its address, then we are using an <font color='blue'>indirect reference</font> to a variable.\n",
    "```C\n",
    "*itemp = 35; /* changes the value of variable m (indirect reference) */\n",
    "m = 40;      /* changes the value of variable m (direct reference) */\n",
    "```"
   ]
  },
  {
   "attachments": {
    "pointerDeclaration.PNG": {
     "image/png": "[encoded data, 49352 characters]"
    }
   },
   "cell_type": "markdown",
   "metadata": {
    "slideshow": {
     "slide_type": "slide"
    }
   },
   "source": [
    "## Pointer Declaration\n",
    "![pointerDeclaration.PNG](attachment:pointerDeclaration.PNG)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "slideshow": {
     "slide_type": "slide"
    }
   },
   "source": [
    "## Student Activity"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "cell_style": "center",
    "slideshow": {
     "slide_type": "-"
    }
   },
   "source": [
    "- Trace the execution of the following C program\n",
    "```C\n",
    "#include <stdio.h>\n",
    "int main(void) {\n",
    "    int m = 10, n = 5;\n",
    "    int *mp, *np;\n",
    "\n",
    "    mp = &m;\n",
    "    np = &n;\n",
    "\n",
    "    *mp = *mp + *np;\n",
    "    *np = *mp - *np;\n",
    "\n",
    "    printf(\"%d %d\\n%d %d\\n\", m, *mp, n, *np);\n",
    "    return (0);\n",
    "}\n",
    "```"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "cell_style": "center",
    "slideshow": {
     "slide_type": "slide"
    }
   },
   "source": [
    "# Functions with Output Parameters\n",
    "- Function arguments (arguments list) enable a function to manipulate different data each time it is called. \n",
    "- So far, we know how to pass inputs to a function and how to use the return statement to send back one result value from a function. \n",
    "- Using indirect references, we can use the argument to return results (in addition to the one returned by the function). "
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "slideshow": {
     "slide_type": "slide"
    }
   },
   "source": [
    "- When a function call executes, the computer allocates memory space **in the function data area** for each formal parameter. \n",
    "- The value of each actual parameter (in the function call) is stored in the memory cell allocated to its corresponding formal parameter (in the function data area).\n",
    "    - This type of function calls is called **call by value**.\n",
    "- The question is: If the function formal parameters are, say, of type `int`, and if we change its value inside the function body, does that affect the actual parameter in the function call?"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "slideshow": {
     "slide_type": "fragment"
    }
   },
   "source": [
    "-  \n",
    "    - The answer is no. Why?\n",
    "    - Because the call is **by value**. So, the value of the variable is copied to the address space of the function.\n",
    "- Now, let us ask this question: If the function formal parameters are, say, of type `int *`, that is a pointer/reference to an integer and if we change its value inside the function body, does that affect the actual parameter in the function call?\n",
    "    - The answer is yes. The reason is that we copied the address (reference) of the variable, not the value of the variable. Hence, inside the function body, when we use `*myVariable = ...`, we change the value of the variable in the main program.\n",
    "    - This type of function calls is called **call by reference**."
   ]
  },
  {
   "attachments": {
    "callByValueReference.PNG": {
     "image/png": "[encoded data, 87652 characters]"
    }
   },
   "cell_type": "markdown",
   "metadata": {
    "slideshow": {
     "slide_type": "slide"
    }
   },
   "source": [
    "## Call by Value vs. Call by Reference\n",
    "- Assume that function `swap` swaps the **integer values** in the body, and that the function `pswap` swaps the integer values **pointed to** by its arguments.\n",
    "![callByValueReference.PNG](attachment:callByValueReference.PNG)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "cell_style": "split",
    "slideshow": {
     "slide_type": "slide"
    }
   },
   "source": [
    "# Pointers to Files\n",
    "- C allows a program to explicitly name a file for input or output.\n",
    "- File pointers can be declared by:\n",
    "```C\n",
    "FILE *inp;\n",
    "FILE *outp;\n",
    "```\n",
    "- Just like Python, you need to first open the files for reading or writing:\n",
    "```C\n",
    "inp  = fopen(\"infile.txt\",\"r\");\n",
    "outp = fopen(\"outfile.txt\",\"w\");\n",
    "```"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "cell_style": "split",
    "slideshow": {
     "slide_type": "fragment"
    }
   },
   "source": [
    "- `fscanf`\n",
    "    - The file equivalent of `scanf`. For example,\n",
    "```C\n",
    "fscanf(inp, \"%1f\", &item);\n",
    "```\n",
    "    - Like `scanf`, it returns the number of successfully read values (or a negative number if the end of file is reached)\n",
    "- `fprintf`\n",
    "    - The file equivalent of `printf`. For example,\n",
    "```C\n",
    "fprintf(outp, \"%.2f\\n\", item);\n",
    "```\n",
    "- Closing a file when done:\n",
    "```C\n",
    "fclose(inp);\n",
    "fclose(outp);\n",
    "```"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "slideshow": {
     "slide_type": "slide"
    }
   },
   "source": [
    "## Example of a program that reads and writes from files.\n",
    "- Note that you need to run C on your machine in order to read from files and write into files."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "slideshow": {
     "slide_type": "-"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Writing indata.txt\n"
     ]
    }
   ],
   "source": [
    "%%writefile indata.txt\n",
    "344 55 6.3556 9.4\n",
    " 43.123 47.596"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "slideshow": {
     "slide_type": "-"
    }
   },
   "outputs": [],
   "source": [
    "#include <stdio.h>\n",
    "\n",
    "int\n",
    "main(void)\n",
    "{\n",
    "      FILE *inp;         /* pointer to input file */\n",
    "      FILE *outp;        /* pointer to ouput file */\n",
    "      double item;\n",
    "      int input_status;  /* status value returned by fscanf */\n",
    "\n",
    "      /* Prepare files for input or output */\n",
    "      inp = fopen(\"indata.txt\", \"r\");\n",
    "      outp = fopen(\"outdata.txt\", \"w\");\n",
    "\n",
    "      /* Input each item, format it, and write it */\n",
    "      input_status = fscanf(inp, \"%lf\", &item);\n",
    "      while (input_status == 1) {\n",
    "          fprintf(outp, \"%.2f\\n\", item);\n",
    "          input_status = fscanf(inp, \"%lf\", &item);\n",
    "      }\n",
    "\n",
    "      /* Close the files */\n",
    "      fclose(inp);\n",
    "      fclose(outp);\n",
    "\n",
    "      return (0);\n",
    "}  \n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "slideshow": {
     "slide_type": "slide"
    }
   },
   "source": [
    "## Example Function with Input and Output Parameters\n",
    "- Consider the following function:\n",
    "```C\n",
    "/*\n",
    " * Separates a number into three parts: a sign (+, -, or blank),\n",
    " * a whole number magnitude, and a fractional part.\n",
    " */\n",
    "\n",
    "  void\n",
    "  separate(double num, /* input - value to be split */\n",
    "           char *signp, /* output - sign of num */\n",
    "           int *wholep, /* output - whole number magnitude of num */\n",
    "           double *fracp) /* output - fractional part of num */\n",
    "{\n",
    "   double magnitude; /* local variable - magnitude of num */\n",
    "   \n",
    "   /* Determines sign of num */\n",
    "   if (num < 0)\n",
    "      *signp = '-';\n",
    "   else if (num == 0)\n",
    "      *signp = ' ';\n",
    "   else\n",
    "      *signp = '+';\n",
    "\n",
    "   /* Finds magnitude of num (its absolute value) and\n",
    "   separates it into whole and fractional parts */\n",
    "   magnitude = fabs(num);\n",
    "   *wholep = floor(magnitude);\n",
    "   *fracp = magnitude - *wholep;\n",
    " }\n",
    "```"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "slideshow": {
     "slide_type": "slide"
    }
   },
   "outputs": [],
   "source": [
    "#include <stdio.h>  \n",
    "#include <math.h>  \n",
    "void separate(double num, char *signp, int *wholep, double *fracp);\n",
    "  \n",
    "int\n",
    "main(void)\n",
    "{\n",
    "      double value; /* input - number to analyze                           */\n",
    "      char sn;      /* output - sign of value                              */\n",
    "      int whl;      /* output - whole number magnitude of value            */\n",
    "      double fr;    /* output - fractional part of value                   */\n",
    "\n",
    "      /* Gets data                                                         */\n",
    "      printf(\"Enter a value to analyze> \");\n",
    "      scanf(\"%lf\", &value);\n",
    "\n",
    "      /* Separates data value into three parts                             */\n",
    "      separate(value, &sn, &whl, &fr);\n",
    "\n",
    "      /* Prints results                                                    */\n",
    "      printf(\"Parts of %.4f\\n sign: %c\\n\", value, sn);\n",
    "      printf(\" whole number magnitude: %d\\n\", whl);\n",
    "      printf(\" fractional part: %.4f\\n\", fr);\n",
    "\n",
    "      return (0);\n",
    "}\n",
    "\n",
    "/*\n",
    " * Separates a number into three parts: a sign (+, -, or blank),\n",
    " * a whole number magnitude, and a fractional part.\n",
    " * Pre: num is defined; signp, wholep, and fracp contain addresses of memory\n",
    " *      cells where results are to be stored\n",
    " * Post: function results are stored in cells pointed to by signp, wholep, and\n",
    " *       fracp\n",
    " */\n",
    "void\n",
    "separate(double num,     /* input - value to be split                      */\n",
    "         char   *signp,  /* output - sign of num                           */\n",
    "         int    *wholep, /* output - whole number magnitude of num         */\n",
    "         double *fracp)  /* output - fractional part of num                */\n",
    "{\n",
    "      double magnitude; /* local variable - magnitude of num               */\n",
    "      /* Determines sign of num */\n",
    "      if (num < 0)\n",
    "            *signp = '-';\n",
    "      else if (num == 0)\n",
    "            *signp = ' ';\n",
    "      else\n",
    "            *signp = '+';\n",
    "\n",
    "      /* Finds magnitude of num (its absolute value) and separates it into\n",
    "         whole and fractional parts                                          */\n",
    "      magnitude = fabs(num);\n",
    "      *wholep = floor(magnitude);\n",
    "      *fracp = magnitude - *wholep;\n",
    "}"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "slideshow": {
     "slide_type": "slide"
    }
   },
   "source": [
    "## Meanings of * Symbol\n",
    "- We have studied 3 meanings of the * symbol:\n",
    "    1. Binary Multiplication Operator.\n",
    "    2. Defining the data type \"pointer to\" in declaring variables\n",
    "        - e.g. `char *signp`\n",
    "    3. Accessing a variable, indirectly, through its address\n",
    "        - e.g. ` *signp = '-'`"
   ]
  },
  {
   "attachments": {},
   "cell_type": "markdown",
   "metadata": {
    "slideshow": {
     "slide_type": "slide"
    }
   },
   "source": [
    "## Student Activity\n",
    "- Write a prototype for a function `sum_n_avg` that has three type `double` input parameters and two output parameters. The function computes the sum and the average of its three input arguments and relays its results through two output parameters\n",
    "![activity2.PNG](attachment:activity2.PNG)\n",
    "- The following code fragment is from a function preparing to call `sum_n_avg`. Complete the function call statement.  \n",
    "```C  \n",
    "{\n",
    " double one, two, three, sum_of_3, avg_of_3;\n",
    " printf(\"Enter three numbers> \");\n",
    " scanf(\"%lf%lf%lf\", &one, &two, &three);\n",
    " sum_n_avg(???);\n",
    "}  \n",
    "```"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "slideshow": {
     "slide_type": "slide"
    }
   },
   "source": [
    "# Multiple Calls to a Function with Input/Output Parameters\n",
    "- We can define a function, in which some input arguments can also act as output results.\n",
    "- Consider developing a function `order` that orders the `double` values in its arguments, such that the first argument will always hold the smaller number and the second argument will always hold the larger number.\n",
    "- First of all, what shall the type of the arguments of function `order` be?"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "slideshow": {
     "slide_type": "fragment"
    }
   },
   "source": [
    "- The type of arguments shall be a pointer to double.\n",
    "```C\n",
    "/*\n",
    " * Arranges arguments in ascending order.\n",
    " * Pre:  smp and lgp are addresses of defined type double variables\n",
    " * Post: variable pointed to by smp contains the smaller of the type\n",
    " *       double values; variable pointed to by lgp contains the larger\n",
    " */\n",
    "void\n",
    "order(double *smp, double *lgp)    /* input/output */\n",
    "{\n",
    "        double temp; /* temporary variable to hold one number during swap      */\n",
    "        /* Compares values pointed to by smp and lgp and switches if necessary */\n",
    "         if (*smp > *lgp) {\n",
    "                 temp = *smp;\n",
    "                 *smp = *lgp;\n",
    "                 *lgp = temp;\n",
    "        }\n",
    "}\n",
    "```"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "slideshow": {
     "slide_type": "slide"
    }
   },
   "source": [
    "- Now, consider the problem of sorting three input numbers, `num1`, `num2` and `num3` from lowest to highest.\n",
    "    - That is, we would like `num1` to hold the smallest value, `num2` to hold the second smallest value, and `num3` to hold the largest value. How can achieve that using the `order` function? "
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "cell_style": "split",
    "slideshow": {
     "slide_type": "fragment"
    }
   },
   "source": [
    "- \n",
    "```\n",
    "  order(num1, num2) -> num1 <= num2\n",
    "  order(num1, num3) -> num1 <= num3\n",
    "  order(num2, num3) -> num2 <= num3\n",
    "```"
   ]
  },
  {
   "attachments": {
    "TraceOfProgramSort.png": {
     "image/png": "[encoded data, 55008 characters]"
    }
   },
   "cell_type": "markdown",
   "metadata": {
    "cell_style": "split",
    "slideshow": {
     "slide_type": "fragment"
    }
   },
   "source": [
    "![TraceOfProgramSort.png](attachment:TraceOfProgramSort.png)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "slideshow": {
     "slide_type": "slide"
    }
   },
   "outputs": [],
   "source": [
    "#include <stdio.h>\n",
    "\n",
    "void order(double *smp, double *lgp);\n",
    "\n",
    "int\n",
    "main(void)\n",
    "{\n",
    "        double num1, num2, num3; /* three numbers to put in order       */\n",
    "\n",
    "        /* Gets test data                                               */\n",
    "        printf(\"Enter three numbers separated by blanks> \");\n",
    "        scanf(\"%lf%lf%lf\", &num1, &num2, &num3);\n",
    "\n",
    "        /* Orders the three numbers                                     */\n",
    "        order(&num1, &num2);\n",
    "        order(&num1, &num3);\n",
    "        order(&num2, &num3);\n",
    "\n",
    "        /* Displays results                                             */\n",
    "        printf(\"The numbers in ascending order are: %.2f %.2f %.2f\\n\",\n",
    "               num1, num2, num3);\n",
    "\n",
    "        return (0);\n",
    "}\n",
    "\n",
    "/*\n",
    " * Arranges arguments in ascending order.\n",
    " * Pre:  smp and lgp are addresses of defined type double variables\n",
    " * Post: variable pointed to by smp contains the smaller of the type\n",
    " *       double values; variable pointed to by lgp contains the larger\n",
    " */\n",
    "void\n",
    "order(double *smp, double *lgp)    /* input/output */\n",
    "{\n",
    "        double temp; /* temporary variable to hold one number during swap      */\n",
    "        /* Compares values pointed to by smp and lgp and switches if necessary */\n",
    "         if (*smp > *lgp) {\n",
    "                 temp = *smp;\n",
    "                 *smp = *lgp;\n",
    "                 *lgp = temp;\n",
    "        }\n",
    "}"
   ]
  },
  {
   "attachments": {
    "KindsOfSubPrograms.png": {
     "image/png": "[encoded data, 105364 characters]"
    }
   },
   "cell_type": "markdown",
   "metadata": {
    "slideshow": {
     "slide_type": "slide"
    }
   },
   "source": [
    "# Summary of Different Types of Functions in C\n",
    "![KindsOfSubPrograms.png](attachment:KindsOfSubPrograms.png)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "slideshow": {
     "slide_type": "slide"
    }
   },
   "source": [
    "# Scope of Names\n",
    "- The **scope of a name** refers to the region of a program where a particular meaning of a name is visible or can be referenced. \n",
    "- The scope of:\n",
    "    - constant macros begins at their definition and continues to the end of the source file. \n",
    "    - a function subprogram begins with its prototype and continues to the end of the source file.\n",
    "    - formal parameters and local variables extends from their declaration to the closing brace of the function in which they were declared.\n",
    "- A local variable or a formal parameter may block the definition of a function (e.g.) if it has the same name."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "slideshow": {
     "slide_type": "slide"
    }
   },
   "source": [
    "## Example\n",
    "- Consider the following C Code:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "cell_style": "split",
    "slideshow": {
     "slide_type": "fragment"
    }
   },
   "outputs": [],
   "source": [
    "#define MAX 950\n",
    "#define LIMIT 200\n",
    "\n",
    "void one(int anarg, double second); /* prototype 1 */\n",
    "\n",
    "int fun_two(int one, char anarg);   /* prototype 2 */\n",
    "\n",
    "int\n",
    "main(void)\n",
    "{\n",
    "         int localvar;\n",
    "        . . .\n",
    "} /* end main */\n",
    "\n",
    "\n",
    "void\n",
    "one(int anarg, double second)       /* header 1     */\n",
    "{\n",
    "        int onelocal;               /* local 1      */\n",
    "        . . .\n",
    "} /* end one */\n",
    "\n",
    "\n",
    "int\n",
    "fun_two(int one, char anarg)        /* header 2     */\n",
    "{\n",
    "        int localvar;               /* local 2      */\n",
    "        . . .\n",
    "} /* end fun_two */"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "cell_style": "split",
    "slideshow": {
     "slide_type": "-"
    }
   },
   "source": [
    "|Name|Visible in main|Visible in one|Visible in fun_two|\n",
    "|:--:|:-------------:|:------------:|:----------------:|\n",
    "|MAX      | yes | yes | yes |\n",
    "|LIMIT    |   |   |   |\n",
    "|main     |   |   |   |\n",
    "|localvar (in **main**) |   |   |   |\n",
    "|one (the function)     |   |  |   |\n",
    "|anarg (**int**)        |    |  |   |\n",
    "|second   |    |  |   |\n",
    "|onelocal |    |  |   |\n",
    "|fun_two  |   |  |  |\n",
    "|one (**formal parameter**) |   |   |  |\n",
    "|anarg (**char**)           |   |   |  |\n",
    "|localvar (in fun_two)      |   |   |  |\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "cell_style": "split",
    "slideshow": {
     "slide_type": "-"
    }
   },
   "source": [
    "|Name|Visible in main|Visible in one|Visible in fun_two|\n",
    "|:--:|:-------------:|:------------:|:----------------:|\n",
    "|MAX      | yes | yes | yes |\n",
    "|LIMIT    | yes | yes | yes |\n",
    "|main     | yes | yes | yes |\n",
    "|localvar (in **main**) | yes | no | no |\n",
    "|one (the function)     | yes | yes| no |\n",
    "|anarg (**int**)        | no  | yes| no |\n",
    "|second   | no  | yes| no |\n",
    "|onelocal |  no | yes| no |\n",
    "|fun_two  | yes | yes| yes|\n",
    "|one (**formal parameter**) | no | no | yes|\n",
    "|anarg (**char**)           | no | no | yes|\n",
    "|localvar (in fun_two)      | no | no | yes|\n"
   ]
  }
 ],
 "metadata": {
  "celltoolbar": "Slideshow",
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.3"
  },
  "rise": {
   "theme": "yellow"
  },
  "toc": {
   "base_numbering": 1,
   "nav_menu": {},
   "number_sections": true,
   "sideBar": true,
   "skip_h1_title": false,
   "title_cell": "Table of Contents",
   "title_sidebar": "Contents",
   "toc_cell": false,
   "toc_position": {},
   "toc_section_display": true,
   "toc_window_display": false
  },
  "varInspector": {
   "cols": {
    "lenName": 16,
    "lenType": 16,
    "lenVar": 40
   },
   "kernels_config": {
    "python": {
     "delete_cmd_postfix": "",
     "delete_cmd_prefix": "del ",
     "library": "var_list.py",
     "varRefreshCmd": "print(var_dic_list())"
    },
    "r": {
     "delete_cmd_postfix": ") ",
     "delete_cmd_prefix": "rm(",
     "library": "var_list.r",
     "varRefreshCmd": "cat(var_dic_list()) "
    }
   },
   "types_to_exclude": [
    "module",
    "function",
    "builtin_function_or_method",
    "instance",
    "_Feature"
   ],
   "window_display": false
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
